//
//  ShopXiangqingZhiDingTableViewCell.m
//  OpenYooxi_IOS
//
//  Created by YeahYes on 15/3/20.
//  Copyright (c) 2015年 com.ivyvi.ee. All rights reserved.
//

#import "ShopXiangqingZhiDingTableViewCell.h"

@implementation ShopXiangqingZhiDingTableViewCell{

    NSArray *imgs;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    
    
    imgs = @[@"2__03",
            @"2__03",
            @"2__03",
            @"2__03",
             @"2__03",
             ];
    
    //1.滚动视图
    //设置分页显示
    _ImgScrollView.pagingEnabled = YES;
    _ImgScrollView.contentSize = CGSizeMake(kScreenWidth*imgs.count, 227);
    //隐藏水平滚动条
    _ImgScrollView.showsHorizontalScrollIndicator = NO;
    _ImgScrollView.delegate = self;
    
    

    
    //2.创建图片视图
    for (NSInteger i=0; i<imgs.count; i++) {
        NSString *name = imgs[i];
        UIImage *img = [UIImage imageNamed:name];
        UIImageView *imgView = [[UIImageView alloc] initWithImage:img];
        imgView.frame = CGRectMake(((kScreenWidth - 176)/2)+kScreenWidth*i, 8, 176, 210);
        [_ImgScrollView addSubview:imgView];
    }
    NSString *shuzi = [NSString stringWithFormat:@"1/%ld",imgs.count];
    _shuzilabel.text = shuzi;
    
    
    _view2.backgroundColor = UIColorFromRGB(0xF8F8F8);
    _guigelabel.textColor = UIColorFromRGB(0x838383);
    
    
    
    _view2.layer.borderColor = UIColorFromRGB(0xE5E5E5).CGColor;
    _view2.layer.borderWidth = 1;
    
    _view3.layer.borderColor = UIColorFromRGB(0xE5E5E5).CGColor;
    _view3.layer.borderWidth = 1;

}


#pragma mark - 滚动事件
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {

        NSInteger page = scrollView.contentOffset.x / kScreenWidth;
    NSString *shuzi = [NSString stringWithFormat:@"%ld/%ld",page+1,imgs.count];
    _shuzilabel.text = shuzi;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
